
import { getList, getOne } from '@/api/subsystemManagement'

/**
* 搜索目标子系统
* @param subSystemQuery 用户输入的表单信息
*/
export async function getSubsystems(subSystemQuery) {
  return new Promise((resolve, reject) => {
    setTimeout(async() => {
      try {
        const res = await getList(subSystemQuery)
        resolve(res)
      } catch (error) {
        reject(error.message)
      }
    }, 1000)
  })
}
/**
 * 获取目标子系统，点击编辑时进行查询
 * @param {子系统id} id
 */
export function getTargetSubsystem(id) {
  return new Promise((resolve, reject) => {
    getOne(id).then(res => {
      resolve(res)
    }).catch((error) => {
      reject(error.message)
    })
  })
}

